<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <style>
                fieldset{
                    margin-right: 15px;
                }
            </style>

            <h:form id="userForm" enctype="multipart/form-data">
                <p:panel id="usuarioPanel" styleClass="clearfix container_24 withoutBorder">
                    <h3 class="title">Visualizar Usuario</h3> <hr/>
                    <p:growl id="messages" showDetail="false" autoUpdate="true"  /> 

                    <p:panel id="userPanel" styleClass="clearfix container_24 withoutBorder">
                        <fieldset>
                            <legend>Dados Gerais</legend>
                            <p:outputLabel value="Nome" styleClass="grid_3" for="nomeInputText"/>
                            <p:inputText id="nomeInputText" styleClass="grid_20" readonly="true"
                                         value="#{managerPesquisarUsuario.showUser.nome}" />

                            <p:outputLabel value="Cargo" styleClass="grid_3" for="cargoInputText" />
                            <p:inputText id="cargoInputText" styleClass="grid_20" readonly="true"
                                         value="#{managerPesquisarUsuario.showUser.profissao}" />

                            <p:outputLabel value="E-mail" styleClass="grid_3" for="emailInputText" />
                            <p:inputText id="emailInputText" styleClass="grid_20" readonly="true"
                                         value="#{managerPesquisarUsuario.showUser.email}" />

                            <p:outputLabel value="Login"  styleClass="grid_3" for="loginInputText" />
                            <p:inputText id="loginInputText" styleClass="grid_20" readonly="true"
                                         value="#{managerPesquisarUsuario.showUser.login}" />
                        </fieldset>
                    </p:panel>

                    <p:panel id="loginPanel" styleClass="clearfix container_24 withoutBorder">
                        <fieldset>
                            <legend>Acesso</legend>
                            <p:dataTable id="tableAcesso" var="g" value="#{managerPesquisarUsuario.showGroups}" 
                                         styleClass="grid_24"
                                         rowIndexVar="rowid"
                                         rowKey="#{u.id}"
                                         rows="5" paginator="true"  
                                         paginatorPosition="bottom"
                                         emptyMessage="Nenhum registro">  
                                <f:facet name="header">
                                    Nível de Acesso
                                </f:facet>
                                <p:column headerText="Grupo" width="600">  
                                    <h:outputText value="#{g.nome}"/>
                                </p:column>  

                            </p:dataTable> 

                        </fieldset>
                    </p:panel>

                    <br/>
                    <div class="buttonAction">

                        <p:button href="pesquisarusuario.xhtml" value="Voltar"  icon="ui-icon-arrowreturnthick-1-w" />
                    </div >
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
